<?php 
class getListsDao extends Dao {
	
	public $table_name = 'lists';
	public $content_table_name ='article';
	public $nav_table_name='nav';
	private $fields = "test,xxx";
	
	/**
	 * 新增用户
	 * @param $user
	 */
	public function addData($data) {
		$data = $this->dao->db->build_key($data, $this->fields);
		return $this->dao->db->insert($data, $this->table_name);
	}


	public function getListsAll($offset='0',$num='20')
	{
		return $this->dao->db->get_all($this->table_name,$num,$offset);
		//return "xasda";
	}

	public function getPlayInfo($identity='')
	{
		$condition = array('identity' =>$identity);
		return $this->dao->db->get_one_by_field($condition,$this->content_table_name);
	}

	public function getNavAll()
	{	
		$condition = array('pid' =>0 );
		return $this->dao->db->get_all($this->nav_table_name,10,0,$condition,'id','asc');
	}
}